package com.lovegu.book.concurrence;

/**
 * @author 老顾
 * @title: ThreadDaemon
 * @projectName java-restudy
 * @email: 1437594522@qq.com
 * @date 2022/11/5 8:57
 */
public class ThreadDaemon {
    public static void main(String[] args) {
        Thread thread = new Thread(new DaemonThread(), "Daemon Thread!");
        thread.setDaemon(false);
        thread.start();
    }
    static class DaemonThread implements Runnable{

        @Override
        public void run() {
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }finally {
                System.out.println("FINISH!");
            }
        }
    }
}
